/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 * \file     Uart_Irq.c                                                                                 *
 * \brief    AUTOSAR 4.3.1 MCAL UART Driver                                                             *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2024/10/29     <td>1.0.0                                                                     *
 * </table>                                                                                             *
 *******************************************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/
#include "Uart.h"
#include "Uart_Ip.h"
#include "Mcal.h"
#include "__regs_base.h"

/********************************************************************************************************
 *                                 Private Macro definition                                             *
 *******************************************************************************************************/
#define UART_ISR(id) \
ISR(Uart_Irq##id##Handler)\
{\
    uint32 channel = Uart_Ip_GetChannelIdx(APB_UART##id##_BASE);\
    if (channel < UART_CHANNEL_MAX)\
    {\
        Uart_Ip_IrqHandler(channel);\
    }\
}

/********************************************************************************************************
 *                                  Global Function Declarations                                        *
 *******************************************************************************************************/
#define UART_START_SEC_CODE
#include "Uart_MemMap.h"

UART_ISR(1)
UART_ISR(2)
UART_ISR(3)
UART_ISR(4)
UART_ISR(5)
UART_ISR(6)
UART_ISR(7)
UART_ISR(8)
UART_ISR(9)
UART_ISR(10)
UART_ISR(11)
UART_ISR(12)
UART_ISR(13)
UART_ISR(14)
UART_ISR(15)
UART_ISR(16)
UART_ISR(17)
UART_ISR(18)
UART_ISR(19)
UART_ISR(20)

#define UART_STOP_SEC_CODE
#include "Uart_MemMap.h"

#ifdef __cplusplus
}
#endif

/* End of file */
